Skip to content

Enable Data Execution Protection and Address Space Layout Randomization on Windows - #134

Closed
dscho wants to merge 2 commits into
gitgitgadget:masterfrom
dscho:aslr
Closed

dscho wants to merge 2 commits into
gitgitgadget:masterfrom
dscho:aslr

Conversation

@dscho

@dscho dscho commented Feb 24, 2019 •

Copy link
Copy Markdown
Member

These two techniques make it harder to come up with exploits, by reducing what is commonly called the "attack surface" in security circles: by making the addresses less predictable, and by making it harder to inject data that is then (mis-)interpreted as code, this hardens Git's executables on Windows.

These patches have been carried in Git for Windows for over 3 years, and should therefore be considered battle-tested.

Changes since v1:

  • When determining whether we build with optimization, -O0 and -Og are explicitly ignored.

@dscho dscho added the ready to submit Has commits that have not been submitted yet label Feb 24, 2019
@dscho

dscho commented Feb 24, 2019

Copy link
Copy Markdown
Member Author

This supersedes #48

@dscho dscho mentioned this pull request Feb 25, 2019
35 tasks done
@dscho

dscho commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

/submit

@gitgitgadget

gitgitgadget Bot commented Apr 29, 2019

Copy link
Copy Markdown

Submitted as pull.134.git.gitgitgadget@gmail.com

@dscho dscho removed the ready to submit Has commits that have not been submitted yet label Apr 29, 2019
Comment thread config.mak.uname Resolved
ismail added 2 commits May 6, 2019 14:24
This is the first step for enabling ASLR (Address Space Layout
Randomization) support. We want to enable ASLR for better protection
against exploiting security holes in Git: it makes it harder to attack
software by making code addresses unpredictable.

The problem fixed by this commit is that `ld.exe` seems to be stripping
relocations which in turn will break ASLR support. We just make sure
it's not stripping the main executable entry.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Enable DEP (Data Execution Prevention) and ASLR (Address Space Layout
Randomization) support. This applies to both 32bit and 64bit builds
and makes it substantially harder to exploit security holes in Git by
offering a much more unpredictable attack surface.

ASLR interferes with GDB's ability to set breakpoints. A similar issue
holds true when compiling with -O2 (in which case single-stepping is
messed up because GDB cannot map the code back to the original source
code properly). Therefore we simply enable ASLR only when an
optimization flag is present in the CFLAGS, using it as an indicator
that the developer does not want to debug in GDB anyway.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho

dscho commented May 8, 2019

Copy link
Copy Markdown
Member Author

/submit

@gitgitgadget

gitgitgadget Bot commented May 8, 2019

Copy link
Copy Markdown

Submitted as pull.134.v2.git.gitgitgadget@gmail.com

@gitgitgadget

gitgitgadget Bot commented May 13, 2019

Copy link
Copy Markdown

This branch is now known as id/windows-dep-aslr.

@gitgitgadget

gitgitgadget Bot commented May 13, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@8a59c5f.

@gitgitgadget gitgitgadget Bot added the pu label May 13, 2019
@gitgitgadget

gitgitgadget Bot commented May 13, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@d69114e.

@gitgitgadget

gitgitgadget Bot commented May 13, 2019

Copy link
Copy Markdown

This patch series was integrated into next via git@33d5706.

@gitgitgadget gitgitgadget Bot added the next label May 13, 2019
@gitgitgadget

gitgitgadget Bot commented May 15, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@b56da75.

@gitgitgadget

gitgitgadget Bot commented May 16, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@9e8d424.

@gitgitgadget

gitgitgadget Bot commented May 19, 2019

Copy link
Copy Markdown

This patch series was integrated into pu via git@f42bee7.

@gitgitgadget

gitgitgadget Bot commented May 19, 2019

Copy link
Copy Markdown

This patch series was integrated into next via git@f42bee7.

@gitgitgadget

gitgitgadget Bot commented May 19, 2019

Copy link
Copy Markdown

This patch series was integrated into master via git@f42bee7.

@gitgitgadget gitgitgadget Bot added the master label May 19, 2019
@gitgitgadget gitgitgadget Bot closed this May 19, 2019
@gitgitgadget

gitgitgadget Bot commented May 19, 2019

Copy link
Copy Markdown

Closed via f42bee7.

@dscho
dscho deleted the aslr branch May 20, 2019 10:25
gitgitgadget Bot pushed a commit that referenced this pull request Mar 17, 2026
Update clar to e4172e3 (Merge pull request #134 from
clar-test/ethomson/const, 2026-01-10). Besides some changes to
"generate.py" which don't have any impact on us, this commit also fixes
compilation on platforms that don't have PATH_MAX, like for example
GNU/Hurd.

Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants